

package cz.results.testperzist.model;

import java.util.*;
import com.db4o.*;

public class Zavodnik {
    
    private int stc;
    private String jmeno;
    private String prijmeni;
    private int nar;
    
    public Zavodnik() {
    }
    
    public Zavodnik(int stc, String jmeno, String prijmeni, int nar) {
        this.stc = stc;
        this.jmeno = jmeno;
        this.prijmeni = prijmeni;
        this.nar = nar;
    }
    
    public static Zavodnik getTestZavodnik() {
        Random rdm = new Random();
        int x = rdm.nextInt(1000);
        return new Zavodnik(x, "jmeno"+x, "prijmeni"+x, 1900+x/10);        
    }
    
    public int getStc() {
        return stc;
    }
    
    public void setStc(int stc) {
        this.stc = stc;
    }
    
    public String getJmeno() {
        return jmeno;
    }
    
    public void setJmeno(String jmeno) {
        this.jmeno = jmeno;
    }
    
    public String getPrijmeni() {
        return prijmeni;
    }
    
    public void setPrijmeni(String prijmeni) {
        this.prijmeni = prijmeni;
    }
    
    public int getNar() {
        return nar;
    }
    
    public void setNar(int nar) {
        this.nar = nar;
    }
    
    public boolean equals(Object obj) {
        if (!(obj instanceof Zavodnik)) {
            return false;
        }
        Zavodnik another = (Zavodnik) obj;
        return jmeno.equals(another.jmeno) && prijmeni.equals(another.prijmeni) && (nar == another.nar);
        
    }
    
   public void objectOnNew(ObjectContainer con)  {
        System.out.println("Zavodnik onNew... ");
    }    
        
}
